Skip to main content
Glama
route.ts687 B
import { NextRequest, NextResponse } from 'next/server'; import { getToolById } from '@/lib/db'; export async function GET(request: NextRequest, { params }: { params: { id: string } }) { try { const id = parseInt(params.id); if (isNaN(id)) { return NextResponse.json({ error: 'Invalid tool ID' }, { status: 400 }); } const tool = await getToolById(id); if (!tool) { return NextResponse.json({ error: 'Tool not found' }, { status: 404 }); } return NextResponse.json({ tool }); } catch (error) { console.error('Error fetching tool:', error); return NextResponse.json({ error: 'Failed to fetch tool' }, { status: 500 }); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/thomasdavis/blah'

If you have feedback or need assistance with the MCP directory API, please join our Discord server